but I have been reading this is bad practice
Images cannot technically be normalized, so traditionally speaking one can make the argument that they belong in the file system rather than something that best works with data that can be normalized. Further, images tend to be large (relatively speaking) - thus insertion and removal can result in table overhead, and - depending upon the database - if the data is large insertion/deletion can cause tables to lock which prevents others from modifying the table until the lock is released. Lastly - depending upon the infrastructure - network overhead may be experienced if the database resides in a different location than the client making the SQL call. In short, one could sum up the above points by saying that storing images in a database does not scale well. The alternative way is to store the photo on the file system and place the path to the file within the appropriate location in the database.